#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin>>n;
    int arr[n+5][n+5];
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= n; ++j)
            cin>>arr[i][j];
    for (int k = -n+1; k <= n; ++k)
        for (int i = 1,j; i <= n; ++i) {
            j=k+i;
            if (j>0 and j<=n)
                cout<<arr[i][j]<<' ';
        }
    return 0;
}